﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Data.GameData.GameMap
{
    public class MapIndex
    {
        #region Attributes
        private int mapId;
        private int row;
        private int column;
        #endregion

        #region Properties
        public int MapId
        {
            get { return mapId; }
            set { mapId = value; }
        }

        public int Row
        {
            get { return row; }
            set { row = value; }
        }

        public int Column
        {
            get { return column; }
            set { column = value; }
        }
        #endregion

        #region Constructors
        public MapIndex()
        {
        }
        public MapIndex(int id, int rowPos, int columnPos)
        {
            mapId = id;
            row = rowPos;
            column = columnPos;
        }
        #endregion

        public override bool Equals(object obj)
        {
            MapIndex other = obj as MapIndex;
            return mapId == other.mapId && row == other.row && column == other.column;
        }

        /// <summary>
        /// Return the textual version of a MapIndex
        /// </summary>
        public override string ToString()
        {
            return "Map:" + mapId.ToString() + " Row:" + row.ToString() + " Col:" + column.ToString();
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}
